package com.bitoon.basketdudes.web.jpa;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity
@Table(name = "ranking_pais", schema="rankings")
@NamedQueries({
    @NamedQuery(name = "RankingPais.findByPaisId", query = "SELECT r FROM RankingPais r WHERE r.paisId = :paisId ORDER BY r.posicion"),
    @NamedQuery(name = "RankingPais.findByEquipoId", query = "SELECT r FROM RankingPais r WHERE r.id = :equipoId")
})
public class RankingPais implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "posicion")
    private int posicion;
    @Basic(optional = false)
    @Column(name = "ant_posicion")
    private int antPosicion;
    @Column(name = "pais_id")
    private String paisId;

    public RankingPais() {
    }

    public RankingPais(Integer id) {
        this.id = id;
    }

    public RankingPais(Integer id, int posicion, int antPosicion) {
        this.id = id;
        this.posicion = posicion;
        this.antPosicion = antPosicion;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getPosicion() {
        return posicion;
    }

    public void setPosicion(int posicion) {
        this.posicion = posicion;
    }

    public int getAntPosicion() {
        return antPosicion;
    }

    public void setAntPosicion(int antPosicion) {
        this.antPosicion = antPosicion;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RankingPais)) {
            return false;
        }
        RankingPais other = (RankingPais) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bitoon.basketdudes.jpa.web.RankingPais_ES[id=" + id + "]";
    }

    public String getPaisId() {
        return paisId;
    }

    public void setPaisId(String paisId) {
        this.paisId = paisId;
    }

}
